package com.runfast.paotui.dao.mapper;

import com.runfast.common.dao.IMapper;
import com.runfast.common.web.entity.Result;
import com.runfast.paotui.dao.model.Order;
import com.runfast.paotui.dao.model.OrderExample;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;
import java.util.Map;

@Mapper
public interface OrderMapper extends IMapper<Order, Integer, OrderExample> {

    Integer findByShopperidAndStatusAndbookTimecount(@Param("shopperid") Integer shopperid,@Param("status")Integer status,@Param("date")Date date );
    List<Order> findByShopperidAndStatusAndbookTime(@Param("shopperid") Integer shopperid,@Param("status")Integer status,@Param("date")Date date );
 List<Order> findByShopperidAndStatus(@Param("shopperid") Integer shopperid, @Param("status") Integer status,@Param("page")Integer page,@Param("pagesize")Integer pagesize);



    Order findByUseridAndCode(@Param("userid") Integer userid, @Param("orderNo") String orderNo);

    void updateStatusAndTime(Order orderuser);

    List<Order> findByShopperid(Integer shopperid);

    List<Order> findListPageBean(@Param("pageSize") Integer pageSize, @Param("page") Integer page, @Param("status") Integer status, @Param("shopperId") Integer shopperId, @Param("agentid") Integer agentid, @Param("teamid") Integer teamid);

    int findCount(@Param("pageSize") Integer pageSize, @Param("page") Integer page, @Param("status") Integer status, @Param("shopperId") Integer shopperId, @Param("agentid") Integer agentid, @Param("teamid") Integer teamid);

    Order findByShopperidAndCode(@Param("shopperid") Integer shopperid, @Param("id") Integer id);

    Order get(Integer id);

    List<Order> findByShopperidAndSize(Integer id);

    List<Map<String,Object>> findAgentIdAndStatus(@Param("agentId") Integer agentId, @Param("status") Integer status, @Param("page")Integer page, @Param("pagesize")Integer pagesize);
    List<Order> findAgentIdAndStatus1(@Param("agentId") Integer agentId, @Param("status") Integer status, @Param("page")Integer page, @Param("pagesize")Integer pagesize);
    Integer findAgentIdAndStatuscount(@Param("agentId") Integer agentId, @Param("i") Integer i, @Param("page1") Integer page1, @Param("pagesize") Integer pagesize);

   Integer findByShopperidAndStatuscount(@Param("id") Integer id, @Param("i") int i);

    Order findbyid(Integer id);

    List<Order> findAllAndTime(@Param("id")Integer id,@Param("page") Integer page, @Param("pagesize") Integer pagesize, @Param("time1") Date time1, @Param("time2") Date time2);
    Integer findAllAndTimecount(@Param("id")Integer id,@Param("page") Integer page, @Param("pagesize") Integer pagesize, @Param("time1") Date time1, @Param("time2") Date time2);

    Integer findByShopperidAndStatuscount3(@Param("shopperid") Integer shopperid, @Param("status") Integer status);

    List<Order> findByShopperidAndStatusSize(Integer shopperid);

    List<Order> findShopperAndStatusErro(Integer shopperid);

    Integer findByShopperidAndStatuscount4(Integer shopperid);

    List<Map<String,String>> findcommisson(@Param("shopperid") Integer shopperid, @Param("date1") Date date1, @Param("date2") Date date2);

    List<Order> findBookTime(@Param("id") Integer id, @Param("dt1") Date dt1,@Param("agentid")Integer agentid);
    Integer  findBookTimecount(@Param("id") Integer id, @Param("dt1") Date dt1,@Param("agentid")Integer agentid);
}